package cn.com.surker.lab.dao;

import cn.com.surker.base.system.entity.SysLine;
import cn.com.surker.lab.entity.LabExpendUploadLine;
import cn.com.surker.lab.vo.LabExpendUploadLineVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import java.util.List;

/**
 * <p>
 * 技术上传配合详情表 Mapper 接口
 * </p>
 *
 * @author admin
 * @since 2024-09-23
 */
public interface LabExpendUploadLineDao extends BaseMapper<LabExpendUploadLine> {

	/**
	 * 根据任务单和生产线查询数据详情
	 *
	 * @param indentId
	 * @param lineId
	 * @return
	 */
	LabExpendUploadLine findByLineId(Long indentId, Long lineId);

	/**
	 * 批量保存
	 * @param list
	 * @return
	 */
	Integer saveBatch(List<LabExpendUploadLine> list);

	/**
	 * 根据配合比ID查询下料配比记录
	 * @param constructId
	 * @return
	 */
	List<LabExpendUploadLine> findByConstruct(Long constructId);

	/**
	 * 根据上传配比主表id查询子项
	 * @param expendId
	 * @return
	 */
	List<LabExpendUploadLineVo> findExpendUploadList(Long expendId);
	List<LabExpendUploadLineVo> findExpendUploadListV1(String dbCode, Long expendId);

	/**
	 * 查询是否存在某种材料
	 * @param orgId
	 * @param type
	 * @param uploadId
	 * @return
	 */
	Integer findExistSn(Long orgId, Integer type, Long uploadId);

	/**
	 * 查询是否存在某种材料用量
	 * @param orgId
	 * @param type
	 * @param uploadId
	 * @return
	 */
	Integer findExistSnDosage(Long orgId, Integer type, Long uploadId);
}
